package com.pwc.conversionTool.IO;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

public final class Writer {
	
	public static void writeObjectToJson(Object object,String path) throws JsonGenerationException, JsonMappingException, IOException
	{
		ObjectMapper mapper = new ObjectMapper();
		mapper.writeValue(new File(path), object);
	}
	
	public static void writeByteArrayToFile(File file,byte[] bytes) throws IOException{
		FileUtils.writeByteArrayToFile(file, bytes);
	}
	
	public static void writeStringToFile(File file,String data) throws IOException
	{
		FileUtils.writeStringToFile(file, data);
	}

}
